package adv5;

import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.util.*;

public class DataInput {

	public static void main(String[] args) {
		//
		try {
			DataOutputStream dout = new DataOutputStream(new FileOutputStream("E:/Temp/1.txt"));
			dout.writeInt(21016);
			dout.writeLong(100000000L);
			dout.writeDouble(Math.PI * Math.E);
			dout.writeBoolean(true);
			dout.writeBoolean(1 > 2);
			dout.close();
			DataInputStream din = new DataInputStream(new FileInputStream("e:/Temp/1.txt"));
			int i = din.readInt();
			System.out.println(i);
			long l = din.readLong();
			System.out.println(l);
			double d = din.readDouble();
			System.out.println(d);
			boolean b1 = din.readBoolean();
			boolean b2 = din.readBoolean();
			System.out.println(b1 + "," + b2);
			din.close();
		} catch (Exception e) {
			// TODO 自动生成的 catch 块
			e.printStackTrace();
		}

	}

}
